
<h1>Cancel class</h1>
<iframe id="id_iframe" name="nm_iframe" style="display:none;"></iframe>
<table class="table table-striped">
    <thead>
      <tr>
        <th>datetime</th>
        <th>student</th>
        <th>teacher</th>
          <th>cancel</th>
      </tr>
    </thead>
    <tbody>
        {% for i in sql %}
            <tr>
                <td>{{ i.train_time }}</td>
                <td>{{ i.student.name }}</td>
                <td>{{ i.teacher.name }}</td>
                {% if i.drop_class == '' or i.drop_class == None %}
                <td><form method="post" target="nm_iframe" action="{{ url('root_cancel') }}" style="display: flex;flex-direction: row;width: 100%">{{ csrf_input }}<input minlength=5 value="cancel" type="text" style="flex: 1" name="sub"><input type="hidden" value="{{ i.id }}" name="id"><input type="submit" onclick="alert('Cancel successfull'),window.location.reload()" value="cancel"  id="cancel"class="btn btn-danger btn-sm"></form></td>
                {% else %}
                 <td>already cancelled</td>
                {% endif %}
            </tr>
        {% endfor %}
    </tbody>
</table>


